$().ready(function() {

});
function obgynedirectory(){
	html='';
	html+='<div class="wrapper-obgyne-directory img-rounded">';
		html+='<div class="wrapper-obgyne-directory-info">';
			html+='<div class="search-obgyne-directory input-prepend img-rounded">';
				html+='<a><span class="search-obgyne-directory-btn add-on">Find</span></a>';
				html+='<input class="span2" id="search_obgyne" type="text" placeholder="Search">';
			html+='</div>';
			html+='<div class="obgyne-directory-names">';
				html+='<ul>';									
				html+='</ul>';
			html+='</div>';
		html+='</div>';
		html+='<div class="wrapper-obgyne-directory-a-z">';
			html+='<div class="obgyne-directory-a-z">';
				html+='<ul>';
					html+='<li><a class="scroll-up"></a></li>';
					html+='<li><a class="a-z">A</a></li>';
					html+='<li><a class="a-z">B</a></li>';
					html+='<li><a class="a-z">C</a></li>';
					html+='<li><a class="a-z">D</a></li>';
					html+='<li><a class="a-z">E</a></li>';
					html+='<li><a class="a-z">F</a></li>';
					html+='<li><a class="a-z">G</a></li>';
					html+='<li><a class="a-z">H</a></li>';
					html+='<li><a class="a-z">I</a></li>';
					html+='<li><a class="a-z">J</a></li>';
					html+='<li><a class="a-z">K</a></li>';
					html+='<li><a class="a-z">L</a></li>';
					html+='<li><a class="a-z">M</a></li>';
					html+='<li><a class="a-z">N</a></li>';
					html+='<li><a class="a-z">O</a></li>';
					html+='<li><a class="a-z">P</a></li>';
					html+='<li><a class="a-z">Q</a></li>';
					html+='<li><a class="a-z">R</a></li>';
					html+='<li><a class="a-z">S</a></li>';
					html+='<li><a class="a-z">T</a></li>';
					html+='<li><a class="a-z">U</a></li>';
					html+='<li><a class="a-z">V</a></li>';
					html+='<li><a class="a-z">W</a></li>';
					html+='<li><a class="a-z">X</a></li>';
					html+='<li><a class="a-z">Y</a></li>';
					html+='<li><a class="a-z">Z</a></li>';
					html+='<li><a class="scroll-down"></a></li>';
				html+='</ul>';
			html+='</div>';
		html+='</div>';
	html+='</div>';	
	$('.box-two-content').html(html);
	$('.box-two .title span').text("OB-gyne Directory");
	$('.scroll-up').click(function(){
		var scroll = $(".obgyne-directory-names").scrollTop();
		$(".obgyne-directory-names").scrollTop(scroll-10);
	});
	$('.scroll-down').click(function(){
		var scroll = $(".obgyne-directory-names").scrollTop();
		$(".obgyne-directory-names").scrollTop(scroll+10);
	});	
	$('.a-z').click(function(){
		$('.loc-day-time-obgyne-directory').show();
		$('.control-obgyne-directory').show();
		var letter = $(this).text();
		if('A'!=letter){
			$('.control-obgyne-directory').each(function(){
				var find_letter = $(this).text();
				if(letter==find_letter){
					//$('#'+find_letter).focus();
					$('.obgyne-directory-names').animate({ scrollTop: 0}, 'fast');
					//console.log($('#'+find_letter).offset().top);
					$('.obgyne-directory-names').animate({ scrollTop: $('#'+find_letter).offset().top }, 'slow');
				}
			});
		}else{
			$(".obgyne-directory-names").animate({
				'scrollTop':0
			});
		}
	});
	$('.search-obgyne-directory-btn').click(function(){
		find_name();
	});	
	$('#search_obgyne').keyup(function(){
		find_name();
	});
	list_ob();
	switchwindow('obgynedirectory');
}
function find_name(){
	var search_obgyne  = $('#search_obgyne').val();
	var obj_list = $('.loc-day-time-obgyne-directory');
	id = search_obgyne.replace(/[^a-zA-Z]/g, "");	
	id = id.toLowerCase();
	$(obj_list).each(function(){
		this_id = this.id;
		if (this_id.indexOf(id) >= 0){
			$(this).show();
			$('#'+this_id[0].toUpperCase()).show();
		} else {
			$(this).hide();
			$('#'+this_id[0].toUpperCase()).hide();
		}
	});
	
}
function chk_array(str, strArray, inc){
    for (var j=0; j<strArray.length; j++) {
    	if(strArray[j]!=undefined){
            if (strArray[j].match(str)) {
            	return j
            };
    	}
    }
    return -1;	
}
function list_ob(){
	var intUserID = $.cookie('session_code');

	xfunc = "obgyne_directory/get_list_obgyne_directory";
	data_sent = {};
	
	$.ajax({ 
		type: "POST", // request type POST
		url: base_url+xfunc, // post to PHP file
		data: data_sent, // request send to PHP file
		dataType:'json',
		success: function(result){ // result = return from php request
			html='';
			var list = [];
			list['A'] = [];
			list['B'] = [];
			list['C'] = [];
			list['D'] = [];
			list['E'] = [];
			list['F'] = [];
			list['G'] = [];
			list['H'] = [];
			list['I'] = [];
			list['J'] = [];
			list['K'] = [];
			list['L'] = [];
			list['M'] = [];
			list['N'] = [];
			list['O'] = [];
			list['P'] = [];
			list['Q'] = [];
			list['R'] = [];
			list['S'] = [];
			list['T'] = [];
			list['U'] = [];
			list['V'] = [];
			list['W'] = [];
			list['X'] = [];
			list['Y'] = [];
			list['Z'] = [];
			inc=1;
			$(result.intID).each(function(k,v){
				name = $.trim(result.strName[k]).toUpperCase();
				search_obgyne = result.strName[k];
				elem_id =  search_obgyne.replace(/[^a-zA-Z]/g, "");
				elem_id = elem_id.toLowerCase();				
				switch(name[0]){
					case 'A':
						list['A'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['A'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['A'], inc);
							if(chk==-1){								
								list['A'][inc]=strChk;
								inc++;
								list['A'][inc]='<br>';
								inc++;									
							}					
							list['A'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['A'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['A'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['A'][inc]='</li>';
						inc++;	
					break;
					case 'B':
						list['B'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['B'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['B'][inc]=strChk;
								inc++;
								list['B'][inc]='<br>';
								inc++;									
							}					
							list['B'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['B'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['B'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['B'][inc]='</li>';
						inc++;	
					break;
					case 'C':
						list['C'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['C'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['C'][inc]=strChk;
								inc++;
								list['C'][inc]='<br>';
								inc++;									
							}					
							list['C'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['C'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['C'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['C'][inc]='</li>';
						inc++;	
					break;	
					case 'D':
						list['D'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['D'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['D'][inc]=strChk;
								inc++;
								list['D'][inc]='<br>';
								inc++;									
							}					
							list['D'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['D'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['D'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['D'][inc]='</li>';
						inc++;					
					break;		
					case 'E':
						list['E'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['E'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['E'][inc]=strChk;
								inc++;
								list['E'][inc]='<br>';
								inc++;									
							}					
							list['E'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['E'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['E'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['E'][inc]='</li>';
						inc++;						
					break;				
					case 'F':
						list['F'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['F'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['F'][inc]=strChk;
								inc++;
								list['F'][inc]='<br>';
								inc++;									
							}					
							list['F'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['F'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['F'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['F'][inc]='</li>';
						inc++;					
					break;			
					case 'G':
						list['G'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['G'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['G'][inc]=strChk;
								inc++;
								list['G'][inc]='<br>';
								inc++;									
							}					
							list['G'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['G'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['G'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['G'][inc]='</li>';
						inc++;						
					break;		
					case 'H':
						list['H'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['H'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['H'][inc]=strChk;
								inc++;
								list['H'][inc]='<br>';
								inc++;									
							}					
							list['H'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['H'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['H'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['H'][inc]='</li>';
						inc++;								
					break;		
					case 'I':
						list['I'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['I'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['I'][inc]=strChk;
								inc++;
								list['I'][inc]='<br>';
								inc++;									
							}					
							list['I'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['I'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['I'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['I'][inc]='</li>';
						inc++;						
					break;		
					case 'J':
						list['J'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['J'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['J'][inc]=strChk;
								inc++;
								list['J'][inc]='<br>';
								inc++;									
							}					
							list['J'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['J'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['J'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['J'][inc]='</li>';
						inc++;						
					break;	
					case 'K':
						list['K'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['K'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['K'][inc]=strChk;
								inc++;
								list['K'][inc]='<br>';
								inc++;									
							}					
							list['K'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['K'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['K'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['K'][inc]='</li>';
						inc++;					
					break;	
					case 'L':
						list['L'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['L'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['L'][inc]=strChk;
								inc++;
								list['L'][inc]='<br>';
								inc++;									
							}					
							list['L'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['L'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['L'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['L'][inc]='</li>';
						inc++;					
					break;	
					case 'M':
						list['M'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['M'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['M'][inc]=strChk;
								inc++;
								list['M'][inc]='<br>';
								inc++;									
							}					
							list['M'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['M'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['M'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['M'][inc]='</li>';
						inc++;					
					break;	
					case 'N':
						list['N'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['N'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['N'][inc]=strChk;
								inc++;
								list['N'][inc]='<br>';
								inc++;									
							}					
							list['N'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['N'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['N'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['N'][inc]='</li>';
						inc++;					
					break;		
					case 'O':
						list['O'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['O'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['O'][inc]=strChk;
								inc++;
								list['O'][inc]='<br>';
								inc++;									
							}					
							list['O'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['O'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['O'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['O'][inc]='</li>';
						inc++;					
					break;		
					case 'P':
						list['P'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['P'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['P'][inc]=strChk;
								inc++;
								list['P'][inc]='<br>';
								inc++;									
							}					
							list['P'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['P'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['P'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['P'][inc]='</li>';
						inc++;					
					break;		
					case 'Q':
						list['Q'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['Q'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['Q'][inc]=strChk;
								inc++;
								list['Q'][inc]='<br>';
								inc++;									
							}					
							list['Q'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Q'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Q'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['Q'][inc]='</li>';
						inc++;					
					break;	
					case 'R':
						list['R'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['R'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['R'][inc]=strChk;
								inc++;
								list['R'][inc]='<br>';
								inc++;									
							}					
							list['R'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['R'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['R'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['R'][inc]='</li>';
						inc++;					
					break;	
					case 'S':
						list['S'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['S'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['S'][inc]=strChk;
								inc++;
								list['S'][inc]='<br>';
								inc++;									
							}					
							list['S'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['S'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['S'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['S'][inc]='</li>';
						inc++;					
					break;		
					case 'T':
						list['T'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['T'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['T'][inc]=strChk;
								inc++;
								list['T'][inc]='<br>';
								inc++;									
							}					
							list['T'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['T'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['T'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['T'][inc]='</li>';
						inc++;					
					break;		
					case 'U':
						list['U'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['U'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['U'][inc]=strChk;
								inc++;
								list['U'][inc]='<br>';
								inc++;									
							}					
							list['U'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['U'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['U'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['U'][inc]='</li>';
						inc++;					
					break;		
					case 'V':
						list['V'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['V'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['V'][inc]=strChk;
								inc++;
								list['V'][inc]='<br>';
								inc++;									
							}					
							list['V'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['V'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['V'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['V'][inc]='</li>';
						inc++;					
					break;	
					case 'W':
						list['W'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['W'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['W'][inc]=strChk;
								inc++;
								list['W'][inc]='<br>';
								inc++;									
							}					
							list['W'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['W'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['W'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['W'][inc]='</li>';
						inc++;					
					break;		
					case 'X':
						list['X'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['X'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['X'][inc]=strChk;
								inc++;
								list['X'][inc]='<br>';
								inc++;									
							}					
							list['X'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['X'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['X'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['X'][inc]='</li>';
						inc++;					
					break;	
					case 'Y':
						list['Y'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['Y'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['Y'][inc]=strChk;
								inc++;
								list['Y'][inc]='<br>';
								inc++;									
							}					
							list['Y'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Y'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Y'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['Y'][inc]='</li>';
						inc++;					
					break;	
					case 'Z':
						list['Z'][0]='<li id="'+name[0]+'" class="control-obgyne-directory title">'+name[0]+'</li>';
						list['Z'][inc]='<li id="'+elem_id+'_'+inc+'" class="loc-day-time-obgyne-directory">';
						inc++;
							strChk = '<i class="name-obgyne-directory"><i class="icon-user"></i><strong>'+result.strSalutation[k]+' '+result.strName[k]+'</strong></i>';
							chk = chk_array(strChk, list['B'], inc);
							if(chk==-1){								
								list['Z'][inc]=strChk;
								inc++;
								list['Z'][inc]='<br>';
								inc++;									
							}					
							list['Z'][inc]='<i class="icon-map-marker"></i><i class="loc">'+result.strLocation[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Z'][inc]='<i class="icon-calendar"></i><i class="day">'+result.strDays[k]+' </i>&nbsp;&nbsp;';
							inc++;
							list['Z'][inc]='<i class="icon-time"></i><i class="time">'+result.strTime[k]+'</i>';
							inc++;
						list['Z'][inc]='</li>';
						inc++;					
					break;						
				}
			});
			for(x=0;x<=inc;x++){
				if(list['A'][x]!=undefined){
					html+=list['A'][x];
				}
			}
			for(x=0;x<=inc;x++){
				if(list['B'][x]!=undefined){
					html+=list['B'][x];
				}
			}
			for(x=0;x<=inc;x++){
				if(list['C'][x]!=undefined){
					html+=list['C'][x];
				}
			}
			for(x=0;x<=inc;x++){
				if(list['D'][x]!=undefined){
					html+=list['D'][x];
				}
			}
			for(x=0;x<=inc;x++){
				if(list['E'][x]!=undefined){
					html+=list['E'][x];
				}
			}		
			for(x=0;x<=inc;x++){
				if(list['F'][x]!=undefined){
					html+=list['F'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['G'][x]!=undefined){
					html+=list['G'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['H'][x]!=undefined){
					html+=list['H'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['I'][x]!=undefined){
					html+=list['I'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['J'][x]!=undefined){
					html+=list['J'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['K'][x]!=undefined){
					html+=list['K'][x];
				}
			}		
			for(x=0;x<=inc;x++){
				if(list['L'][x]!=undefined){
					html+=list['L'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['M'][x]!=undefined){
					html+=list['M'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['N'][x]!=undefined){
					html+=list['N'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['O'][x]!=undefined){
					html+=list['O'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['P'][x]!=undefined){
					html+=list['P'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['Q'][x]!=undefined){
					html+=list['Q'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['R'][x]!=undefined){
					html+=list['R'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['S'][x]!=undefined){
					html+=list['S'][x];
				}
			}	
			for(x=0;x<=inc;x++){
				if(list['T'][x]!=undefined){
					html+=list['T'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['U'][x]!=undefined){
					html+=list['U'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['V'][x]!=undefined){
					html+=list['V'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['W'][x]!=undefined){
					html+=list['W'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['X'][x]!=undefined){
					html+=list['X'][x];
				}
			}	
			for(x=0;x<=inc;x++){
				if(list['Y'][x]!=undefined){
					html+=list['Y'][x];
				}
			}			
			for(x=0;x<=inc;x++){
				if(list['Z'][x]!=undefined){
					html+=list['Z'][x];
				}
			}			
			$('.obgyne-directory-names ul').html(html);
		}
	});
}